package gui.typeEditors;

import java.awt.event.ActionListener;
import java.awt.event.FocusListener;

public class FloatEditor extends NumberEditor<Float> implements ActionListener, FocusListener
	{
	private static final long serialVersionUID = 6195335893738468963L;
	
	public FloatEditor(float initialValue, float outputMultiplier, int columns, boolean permitGrowing)
		{
		super(initialValue, outputMultiplier, columns, permitGrowing);
		}
	
	public FloatEditor(float initialValue, float displayValueMultiplier)
		{
		this(initialValue, displayValueMultiplier, DEFAULT_COLUMNS, true);
		}
	
	@Override
	public Float getValue()
		{
		return (float)value;
		}

	@Override
	protected Float div(Float value, Float divisor)
		{
		return value/divisor;
		}

	@Override
	protected Float mul(Float value, Float factor)
		{
		return value*factor;
		}

	@Override
	protected Float parse(String text)
		{
		return Float.parseFloat(text);
		}
	}
